package com.burstly.jackson.map.deser.std;

import com.burstly.jackson.JsonNode;
import com.burstly.jackson.JsonParser;
import com.burstly.jackson.JsonParser.NumberType;
import com.burstly.jackson.JsonProcessingException;
import com.burstly.jackson.JsonToken;
import com.burstly.jackson.map.DeserializationConfig.Feature;
import com.burstly.jackson.map.DeserializationContext;
import com.burstly.jackson.map.JsonMappingException;
import com.burstly.jackson.map.TypeDeserializer;
import com.burstly.jackson.node.ArrayNode;
import com.burstly.jackson.node.JsonNodeFactory;
import com.burstly.jackson.node.ObjectNode;
import java.io.IOException;

abstract class BaseNodeDeserializer<N extends JsonNode> extends StdDeserializer<N>
{
  public BaseNodeDeserializer(Class<N> paramClass)
  {
    super(paramClass);
  }

  protected void _handleDuplicateField(String paramString, ObjectNode paramObjectNode, JsonNode paramJsonNode1, JsonNode paramJsonNode2)
    throws JsonProcessingException
  {
  }

  protected void _reportProblem(JsonParser paramJsonParser, String paramString)
    throws JsonMappingException
  {
    throw new JsonMappingException(paramString, paramJsonParser.getTokenLocation());
  }

  protected final JsonNode deserializeAny(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, JsonNodeFactory paramJsonNodeFactory)
    throws IOException, JsonProcessingException
  {
    switch ($SWITCH_TABLE$com$burstly$jackson$JsonToken()[paramJsonParser.getCurrentToken().ordinal()])
    {
    case 3:
    case 5:
    default:
      throw paramDeserializationContext.mappingException(getValueClass());
    case 2:
      return deserializeObject(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory);
    case 4:
      return deserializeArray(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory);
    case 6:
      return deserializeObject(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory);
    case 7:
      Object localObject = paramJsonParser.getEmbeddedObject();
      if (localObject == null)
        return paramJsonNodeFactory.nullNode();
      if (localObject.getClass() == [B.class)
        return paramJsonNodeFactory.binaryNode((byte[])localObject);
      return paramJsonNodeFactory.POJONode(localObject);
    case 8:
      return paramJsonNodeFactory.textNode(paramJsonParser.getText());
    case 9:
      JsonParser.NumberType localNumberType = paramJsonParser.getNumberType();
      if ((localNumberType == JsonParser.NumberType.BIG_INTEGER) || (paramDeserializationContext.isEnabled(DeserializationConfig.Feature.USE_BIG_INTEGER_FOR_INTS)))
        return paramJsonNodeFactory.numberNode(paramJsonParser.getBigIntegerValue());
      if (localNumberType == JsonParser.NumberType.INT)
        return paramJsonNodeFactory.numberNode(paramJsonParser.getIntValue());
      return paramJsonNodeFactory.numberNode(paramJsonParser.getLongValue());
    case 10:
      if ((paramJsonParser.getNumberType() == JsonParser.NumberType.BIG_DECIMAL) || (paramDeserializationContext.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS)))
        return paramJsonNodeFactory.numberNode(paramJsonParser.getDecimalValue());
      return paramJsonNodeFactory.numberNode(paramJsonParser.getDoubleValue());
    case 11:
      return paramJsonNodeFactory.booleanNode(true);
    case 12:
      return paramJsonNodeFactory.booleanNode(false);
    case 13:
    }
    return paramJsonNodeFactory.nullNode();
  }

  protected final ArrayNode deserializeArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, JsonNodeFactory paramJsonNodeFactory)
    throws IOException, JsonProcessingException
  {
    ArrayNode localArrayNode = paramJsonNodeFactory.arrayNode();
    while (true)
      switch ($SWITCH_TABLE$com$burstly$jackson$JsonToken()[paramJsonParser.nextToken().ordinal()])
      {
      case 3:
      case 6:
      case 7:
      default:
        localArrayNode.add(deserializeAny(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory));
        break;
      case 2:
        localArrayNode.add(deserializeObject(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory));
        break;
      case 4:
        localArrayNode.add(deserializeArray(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory));
        break;
      case 8:
        localArrayNode.add(paramJsonNodeFactory.textNode(paramJsonParser.getText()));
      case 5:
      }
    return localArrayNode;
  }

  protected final ObjectNode deserializeObject(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, JsonNodeFactory paramJsonNodeFactory)
    throws IOException, JsonProcessingException
  {
    ObjectNode localObjectNode = paramJsonNodeFactory.objectNode();
    JsonToken localJsonToken = paramJsonParser.getCurrentToken();
    if (localJsonToken == JsonToken.START_OBJECT)
      localJsonToken = paramJsonParser.nextToken();
    if (localJsonToken != JsonToken.FIELD_NAME)
      return localObjectNode;
    String str = paramJsonParser.getCurrentName();
    Object localObject;
    switch ($SWITCH_TABLE$com$burstly$jackson$JsonToken()[paramJsonParser.nextToken().ordinal()])
    {
    default:
      localObject = deserializeAny(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory);
    case 2:
    case 4:
    case 8:
    }
    while (true)
    {
      JsonNode localJsonNode = localObjectNode.put(str, (JsonNode)localObject);
      if (localJsonNode != null)
        _handleDuplicateField(str, localObjectNode, localJsonNode, (JsonNode)localObject);
      localJsonToken = paramJsonParser.nextToken();
      break;
      localObject = deserializeObject(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory);
      continue;
      localObject = deserializeArray(paramJsonParser, paramDeserializationContext, paramJsonNodeFactory);
      continue;
      localObject = paramJsonNodeFactory.textNode(paramJsonParser.getText());
    }
  }

  public Object deserializeWithType(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, TypeDeserializer paramTypeDeserializer)
    throws IOException, JsonProcessingException
  {
    return paramTypeDeserializer.deserializeTypedFromAny(paramJsonParser, paramDeserializationContext);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.jackson.map.deser.std.BaseNodeDeserializer
 * JD-Core Version:    0.6.2
 */